counting nodes of singly linked list